<!DOCTYPE html>
<html>
<head>
		<title>用户主页面</title>
	<meta charset="UTF-8">
	<script type="text/javascript" src="../jquery/jquery-1.11.3.js"></script>
	<link rel="stylesheet" href="../CSS/userIndex.css">
</head>
<body>
	<div id="Header">
		<div class="Header-Logo">
			<a href="http://www.baidu.com">
				<img src="../images/yy.png" alt="YY招聘网">
			</a>
		</div>
		<div class="Header-Logo-Right">
			<ul>
				<li>
					<a href="../system/userResume.html">我的档案</a>
				</li><li>
					<a id="getCompany" href="./CompanyInfo.html" target="_blank">公司</a>
				</li>
			</ul>
		</div>
	</div>
	<div id="Content">
		<div class="Content-Background"></div>
		<div class="Content-Background-Content"></div>
	</div>
	
	<script>
		document.getElementById("getCompany").onclick = function(){
			//alert("yy");
		}
		
	
		
		var request = new XMLHttpRequest();
		var URL = "../user/redirectIndex.action";
		var type = "GET";
		request.open(type,URL);
		request.onreadystatechange = function(){							  //定义事件处理程序
			if(request.readyState === 0){
				//alert("open()尚未调用");
			}
			if(request.readyState === 1){
				//alert("open()已经调用");
			}
			if(request.readyState === 2){
				//alert("接收到头信息");
			}
			if(request.readyState === 3){
				//alert("接收到响应主体");
			}
			if(request.readyState===4 && request.status===200){
				var type = request.getResponseHeader("Content-Type");
				var sessionstatus=request.getResponseHeader("sessionstatus"); 
				if(sessionstatus == "nosession"){
					alert("请先登录！");
					window.location.href = "./UserLogin.html";
				}
				if(type.indexOf("xml")!==-1 && request.responseXML){		//Document对象响应
					alert("yesss");
				}
				else if(type === "application/json"){						//JSON响应	
					alert("000000000");
				}
				else{														//字符串响应
					nameState = request.responseText;
					//alert("yonghuming+"+nameState);
					localStorage.setItem("loginName2",nameState);
					//alert(localStorage.getItem("loginName2")+"+aaaaaaaaaaa");
				}
			}
		};
		request.send();
		//alert("yes2");
	</script>
</body>
</html>